<%--
  Created by IntelliJ IDEA.
  User: 朱泽丹
  Date: 2021-12-09
  Time: 10:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>练习ajax发起带数据的简单请求</title>
    <script src="${pageContext.request.contextPath}/js/jquery-3.3.1.js"></script>
    <script>
        function a1(){
            $.post({
                url:"${pageContext.request.contextPath}/a1.action",//请求地址，必须有
                data:{'name':$("myName").val()},
                success:function (data,status){
                    alert(data);
                    alert(status);
                }
            });
        }
    </script>
</head>
<body>
用户名：<input type="text" id="myName" value="admin" onblur="a1()">
</body>
</html>
